<HTML>
<HEAD>
<TITLE>
PropertyDefinition.h
</TITLE>
</HEAD>
<BODY>
<PRE>
<font color="green">/*
* Copyright 2006 the original author or authors.
* 
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* 
*      http://www.apache.org/licenses/LICENSE-2.0
* 
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/</font>

<font color="blue">#ifndef</font> AUTUMN_PROPERTYDEFINITION_H
<font color="blue">#define</font> AUTUMN_PROPERTYDEFINITION_H

<font color="blue">#include</font> <font color="maroon">&#60;string&#62;</font>
<font color="blue">#include</font> <font color="maroon">"Basic.h"</font>

<font color="blue">using</font> <font color="blue">namespace</font> std;

<font color="blue">namespace</font> Autumn<font color="black">{</font>

<font color="green">/** 
 * Contains property's information
 * @version 0.1.0
 * @since 2006-11-23
 */</font>
<font color="blue">class</font> PropertyDefinition<font color="black">{</font>
<font color="blue">private</font><font color="black">:</font>
    <font color="green">/** Property's name */</font>
    string Name;

    <font color="green">/** Property value's type */</font>
    string Type;

    <font color="green">/** 
     * Property's value string. If Type is Object, Value will be a object's
     * name. 
     */</font>
    StrValueList Value;

<font color="blue">public</font><font color="black">:</font>
    <font color="green">/** Create a new PropertyDefine */</font>
    PropertyDefinition<font color="black">(</font><font color="blue">const</font> string<font color="black">&</font> <font color="blue">name</font>, <font color="blue">const</font> string<font color="black">&</font> type,
                        StrValueList value<font color="black">)</font><font color="black">{</font>
        <font color="blue">this</font><font color="black">-</font><font color="black">&#62;</font>Name <font color="black">=</font> <font color="blue">name</font>;
        <font color="blue">this</font><font color="black">-</font><font color="black">&#62;</font>Type <font color="black">=</font> type;
        <font color="blue">this</font><font color="black">-</font><font color="black">&#62;</font>Value <font color="black">=</font> value;
    <font color="black">}</font>

    <font color="green">/** Return property's name */</font>
    string getName<font color="black">(</font><font color="black">)</font> <font color="blue">const</font> <font color="black">{</font>
        <font color="blue">return</font> <font color="blue">this</font><font color="black">-</font><font color="black">&#62;</font>Name;
    <font color="black">}</font>

    <font color="green">/** Return property value's type */</font>
    string getType<font color="black">(</font><font color="black">)</font> <font color="blue">const</font> <font color="black">{</font>
        <font color="blue">return</font> <font color="blue">this</font><font color="black">-</font><font color="black">&#62;</font>Type;
    <font color="black">}</font>

    <font color="green">/** Return the string list of property's value */</font>
    <font color="blue">const</font> StrValueList<font color="black">&</font> getValueString<font color="black">(</font><font color="black">)</font> <font color="blue">const</font> <font color="black">{</font>
        <font color="blue">return</font> <font color="blue">this</font><font color="black">-</font><font color="black">&#62;</font>Value;
    <font color="black">}</font>
<font color="black">}</font>;

<font color="black">}</font> <font color="green">// End namespace Autumn</font>
<font color="blue">#endif</font>

</PRE>
</BODY>
</HTML>
